<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>零宽断言</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
    </style>
</head>
<body>
	<div class="container">
		<h1>零宽断言</h1>
		<input type="text" name="username" value="向军123" id="inp1">
	</div>
	<script src="https://cdn.staticfile.org/jquery/3.2.0/jquery.js"></script>
	<script type="text/javascript">
	var reg = /^(?!.*向军).*/i
	var reg = /^(?!.*向军.*).*/i
	inp1.addEventListener('keyup', function(){
		var result = this.value.match(reg)
		if(result) {
			console.log(result)
		}
	})
	</script>
</body>
</html>